package com.zsk.shop.enums;

/**
 * 提现方式 1银行卡2微信3支付宝
 *
 * @author ljh
 * @create 2021/5/18 10:22
 */
public enum EnumWithdrawType {
    CARD("银行卡", 1),
    WECHAT("微信", 2),
    ALIPAY("支付宝", 3);

    EnumWithdrawType(String value, Integer code) {
        this.value = value;
        this.code = code;
    }

    String value;
    Integer code;

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public static String getNameByCode(Integer code) {
        EnumWithdrawType[] enums = EnumWithdrawType.values();
        for (int i = 0; i < enums.length; i++) {
            if (enums[i].getCode().equals(code)) {
                return enums[i].getValue();
            }
        }
        return "";
    }
}
